ENABLE_TESTING()
ADD_CUSTOM_TARGET(check_nestk command ctest)

MACRO(NEW_TEST name use_win32)
    IF (WIN32 AND ${use_win32})
      ADD_EXECUTABLE(${name} WIN32 ${name}.cpp test_common.h)
    ELSE (WIN32 AND ${use_win32})
      ADD_EXECUTABLE(${name} ${name}.cpp)
    ENDIF (WIN32 AND ${use_win32})

    TARGET_LINK_LIBRARIES(${name} nestk)
    ADD_DEPENDENCIES(check ${name})
    ADD_TEST(${name} ${name})
ENDMACRO(NEW_TEST)

IF (NESTK_USE_FREENECT)
  NEW_TEST(test-kinect-3d 0)
  NEW_TEST(test-kinect-grabber 0)
  NEW_TEST(test-async-grabber 0)
ENDIF ()

IF (NESTK_USE_OPENNI)
  NEW_TEST(test-nite 0)
  NEW_TEST(test-multiple-kinect 0)
ENDIF()

NEW_TEST(test-opencv-grabber 0)
NEW_TEST(test-siftgpu 0)
NEW_TEST(test-siftgpu-server 0)
NEW_TEST(test-features 0)
IF (NESTK_USE_OPENCL)
  NEW_TEST(test-gpu 0)
ENDIF()

NEW_TEST(test-math 0)
NEW_TEST(test-hscolor 0)
NEW_TEST(test-distributions 0)
NEW_TEST(test-algorithm 0)
NEW_TEST(test-minimizers 0)
NEW_TEST(test-mesh 0)
NEW_TEST(test-transactions 0)
NEW_TEST(test-stl 0)
NEW_TEST(test-pose3d 0)
#NEW_TEST(test-estimation 0)
NEW_TEST(test-transform 0)
NEW_TEST(test-threads 0)
NEW_TEST(test-serialization 0)
#NEW_TEST(test-hypothesis-testing 0)

IF (NESTK_USE_PCL)
  NEW_TEST(test-pcl 0)
ENDIF()

